package com.jingtao.product.service;

import com.jingtao.common.core.domain.R;
import com.jingtao.product.domain.Product;
import com.jingtao.product.domain.Result.ProductResult;
import com.jingtao.product.domain.vo.ProductParam;
import com.jingtao.product.domain.vo.QueryProductVo;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName:
 * @Description:
 * @Author: zengfanzhen
 * @Date: 2024/3/26 19:08:23
 */
public interface ProductService {
    /**
     * 添加商品信息
     * @param product
     * @return
     */
    R addProduct(Product product);

    List<Product> queryProduct(QueryProductVo queryProductVo);


    /**
     * 添加商品信息
     * @param productParam
     * @return
     */
    @Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    int create(ProductParam productParam);

    /**
     * 根据商品编号获取更新信息
     */
    ProductResult getUpdateInfo(Long id);

    /**
     * 更新商品
     */
    @Transactional
    int update(Long id, ProductParam productParam);

}
